package com.jindu.producer.finance.jpa;

import com.jindu.producer.finance.model.CContentEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author jarvis
 * @date 2018-3-20
 */
@Transactional
public interface ContentJpa extends JpaRepository<CContentEntity,Long>,JpaSpecificationExecutor {

    CContentEntity findById(String id);

    /**
     * 根据id删除数据
     * @param id
     * @return
     */
    @Modifying
    @Query("delete from CContentEntity where id = ?1 ")
    int deleteById(String id);

}
